CREATE TABLE [dbo].[TDREAP_INSA]
(
[CO_SIST] [dbo].[TD_VC_008] NOT NULL,
[CO_MODU] [dbo].[TD_VC_008] NOT NULL,
[CO_MENU] [dbo].[TD_VC_020] NOT NULL,
[CO_USUA] [dbo].[TD_VC_008] NOT NULL,
[TI_CONE] [dbo].[TD_VC_003] NOT NULL,
[NU_SECU] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TDREAP_IN__NU_SE__2B3F6F97] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TDREAP_IN__CO_US__2C3393D0] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TDREAP_IN__FE_US__2D27B809] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TDREAP_IN__CO_US__2E1BDC42] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TDREAP_IN__FE_US__2F10007B] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDREAP_INSA] ADD CONSTRAINT [PK__TDREAP_I__DC9B52F663A3C44B] PRIMARY KEY CLUSTERED  ([CO_SIST], [CO_MODU], [CO_MENU], [CO_USUA], [TI_CONE], [NU_SECU]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDREAP_INSA] ADD CONSTRAINT [FK__TDREAP_INSA__24485945] FOREIGN KEY ([CO_SIST], [CO_MODU], [CO_MENU]) REFERENCES [dbo].[TMMENU] ([CO_SIST], [CO_MODU], [CO_MENU])
GO
ALTER TABLE [dbo].[TDREAP_INSA] ADD CONSTRAINT [FK__TDREAP_IN__CO_US__2354350C] FOREIGN KEY ([CO_USUA]) REFERENCES [dbo].[TMUSUA] ([CO_USUA])
GO
GRANT SELECT ON  [dbo].[TDREAP_INSA] TO [public]
GRANT INSERT ON  [dbo].[TDREAP_INSA] TO [public]
GRANT DELETE ON  [dbo].[TDREAP_INSA] TO [public]
GRANT UPDATE ON  [dbo].[TDREAP_INSA] TO [public]
GO
